Optimal. Leaf size=102 \[ -\frac {(i a-b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{\sqrt {a-i b} d}+\frac {(i a+b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b} d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {3620, 3618, 65,
214} \begin {gather*} \frac {(b+i a) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{d \sqrt {a+i b}}-\frac {(-b+i a) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{d \sqrt {a-i b}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3618
Rule 3620
Rubi steps
\begin {align*} \int \frac {-a+b \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx &=\frac {1}{2} (-a-i b) \int \frac {1+i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx+\frac {1}{2} (-a+i b) \int \frac {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx\\ &=\frac {(i a-b) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a-i b x}} \, dx,x,i \cot (c+d x)\right )}{2 d}-\frac {(i a+b) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a+i b x}} \, dx,x,-i \cot (c+d x)\right )}{2 d}\\ &=-\frac {(a-i b) \text {Subst}\left (\int \frac {1}{-1+\frac {i a}{b}-\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{b d}-\frac {(a+i b) \text {Subst}\left (\int \frac {1}{-1-\frac {i a}{b}+\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{b d}\\ &=-\frac {(i a-b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{\sqrt {a-i b} d}+\frac {(i a+b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b} d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.48, size = 156, normalized size = 1.53 \begin {gather*} \frac {\left (\sqrt {a+i b} (-i a+b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )+\sqrt {a-i b} (i a+b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )\right ) (a-b \cot (c+d x)) \sin (c+d x)}{\sqrt {a-i b} \sqrt {a+i b} d (-b \cos (c+d x)+a \sin (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(782\) vs.
\(2(84)=168\).
time = 0.66, size = 783, normalized size = 7.68
method | result | size |
derivativedivides | \(-\frac {2 b \left (\frac {\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{4}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{4}\right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-4 a^{3} b^{2}-4 a \,b^{4}-\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{4}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{4}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}+\frac {-\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{4}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{4}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (4 a^{3} b^{2}+4 a \,b^{4}+\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{4}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{4}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{d}\) | \(783\) |
default | \(-\frac {2 b \left (\frac {\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{4}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{4}\right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-4 a^{3} b^{2}-4 a \,b^{4}-\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{4}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{4}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}+\frac {-\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{4}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{4}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (4 a^{3} b^{2}+4 a \,b^{4}+\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{4}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{4}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{d}\) | \(783\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \int \frac {a}{\sqrt {a + b \cot {\left (c + d x \right )}}}\, dx - \int \left (- \frac {b \cot {\left (c + d x \right )}}{\sqrt {a + b \cot {\left (c + d x \right )}}}\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.20, size = 2731, normalized size = 26.77 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________